<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    输入行：<input type="text" id="num1" /> 输入列：<inputtype
      ="text"
      id="num2"
    />
    <button id="but">提交</button>
    <script>
      //   for (b = 1; b <= 5; b++) {
      //     for (i = 1; i <= 5; i++) {
      //       document.write("*");
      //     }
      //     document.write("<br>");
      //   }
      var num1Ele = document.getElementById("num1");
      var num2Ele = document.getElementById("num2");
      var butEle = document.getElementById("but");
      but.onclick = function () {
        var num1 = parseInt(num1Ele.value);
        var num2 = parseInt(num2Ele.value);
        for (var i = 0; i < num1; i++) {
          for (var j = 0; j < num2; j++) {
            document.write("*");
          }
          document.write("<br>");
        }
      };
    </script>
  </body>
</html>
